home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / oper_sys / mach / amiga / tools / gcc040pd.lha / as.info-2 < prev    next >
Encoding:
GNU Info File  |  1992-09-30  |  33.1 KB  |  1,036 lines

  1. This is Info file as.info, produced by Makeinfo-1.43 from the input
  2. file as-680x0.texinfo.
  3.  
  4.    This file documents the GNU Assembler "as".
  5.  
  6.    Copyright (C) 1991 Free Software Foundation, Inc.
  7.  
  8.    Permission is granted to make and distribute verbatim copies of
  9. this manual provided the copyright notice and this permission notice
  10. are preserved on all copies.
  11.  
  12.    Permission is granted to copy and distribute modified versions of
  13. this manual under the conditions for verbatim copying, provided also
  14. that the section entitled "GNU General Public License" is included
  15. exactly as in the original, and provided that the entire resulting
  16. derived work is distributed under the terms of a permission notice
  17. identical to this one.
  18.  
  19.    Permission is granted to copy and distribute translations of this
  20. manual into another language, under the above conditions for modified
  21. versions, except that the section entitled "GNU General Public
  22. License" may be included in a translation approved by the Free
  23. Software Foundation instead of in the original English.
  24.  
  25. 
  26. File: as.info,  Node: Infix Ops,  Prev: Prefix Ops,  Up: Integer Exprs
  27.  
  28. Infix Operators
  29. ---------------
  30.  
  31.    "Infix operators" take two arguments, one on either side.  Operators
  32. have precedence, but operations with equal precedence are performed
  33. left to right.  Apart from `+' or `-', both arguments must be
  34. absolute, and the result is absolute.
  35.  
  36.   1. Highest Precedence
  37.  
  38.     `*'
  39.           "Multiplication".
  40.  
  41.     `/'
  42.           "Division".  Truncation is the same as the C operator `/'
  43.  
  44.     `%'
  45.           "Remainder".
  46.  
  47.     `<'
  48.     `<<'
  49.           "Shift Left".  Same as the C operator `<<'
  50.  
  51.     `>'
  52.     `>>'
  53.           "Shift Right".  Same as the C operator `>>'
  54.  
  55.   2. Intermediate precedence
  56.  
  57.     `|'
  58.           "Bitwise Inclusive Or".
  59.  
  60.     `&'
  61.           "Bitwise And".
  62.  
  63.     `^'
  64.           "Bitwise Exclusive Or".
  65.  
  66.     `!'
  67.           "Bitwise Or Not".
  68.  
  69.   3. Lowest Precedence
  70.  
  71.     `+'
  72.           "Addition".  If either argument is absolute, the result has
  73.           the section of the other argument.  If either argument is
  74.           pass1 or undefined, the result is pass1.  Otherwise `+' is
  75.           illegal.
  76.  
  77.     `-'
  78.           "Subtraction".  If the right argument is absolute, the
  79.           result has the section of the left argument.  If either
  80.           argument is pass1 the result is pass1.  If either argument
  81.           is undefined the result is difference section.  If both
  82.           arguments are in the same section, the result is
  83.           absolute--provided that section is one of text, data or bss. 
  84.           Otherwise subtraction is illegal.
  85.  
  86.    The sense of the rule for addition is that it's only meaningful to
  87. add the *offsets* in an address; you can only have a defined section in
  88. one of the two arguments.
  89.  
  90.    Similarly, you can't subtract quantities from two different
  91. sections.
  92.  
  93. 
  94. File: as.info,  Node: Pseudo Ops,  Next: M68K-Dependent,  Prev: Expressions,  Up: Top
  95.  
  96. Assembler Directives
  97. ********************
  98.  
  99.    All assembler directives have names that begin with a period (`.'). 
  100. The rest of the name is letters, usually in lower case.
  101.  
  102.    This chapter discusses directives present regardless of the target
  103. machine configuration for the GNU assembler.  *Note M68K-Dependent::
  104. for additional directives.
  105.  
  106. * Menu:
  107.  
  108. * Abort::            `.abort'
  109. * Align::            `.align ABS-EXPR , ABS-EXPR'
  110. * App-File::            `.app-file STRING'
  111. * Ascii::            `.ascii "STRING"'...
  112. * Asciz::            `.asciz "STRING"'...
  113. * Byte::            `.byte EXPRESSIONS'
  114. * Comm::            `.comm SYMBOL , LENGTH '
  115. * Data::            `.data SUBSECTION'
  116. * Desc::            `.desc SYMBOL, ABS-EXPRESSION'
  117. * Double::            `.double FLONUMS'
  118. * Eject::            `.eject'
  119. * Else::            `.else'
  120. * Endif::            `.endif'
  121. * Equ::                `.equ SYMBOL, EXPRESSION'
  122. * Extern::            `.extern'
  123. * File::            `.file STRING'
  124. * Fill::            `.fill REPEAT , SIZE , VALUE'
  125. * Float::            `.float FLONUMS'
  126. * Global::            `.global SYMBOL', `.globl SYMBOL'
  127. * hword::            `.hword EXPRESSIONS'
  128. * Ident::            `.ident'
  129. * If::                `.if ABSOLUTE EXPRESSION'
  130. * Include::            `.include "FILE"'
  131. * Int::                `.int EXPRESSIONS'
  132. * Lcomm::            `.lcomm SYMBOL , LENGTH'
  133. * Lflags::                      `.lflags'
  134. * Line::            `.line LINE-NUMBER'
  135. * Ln::                `.ln LINE-NUMBER'
  136. * List::            `.list'
  137. * Long::            `.long EXPRESSIONS'
  138. * Lsym::            `.lsym SYMBOL, EXPRESSION'
  139. * Nolist::            `.nolist'
  140. * Octa::            `.octa BIGNUMS'
  141. * Org::                `.org NEW-LC , FILL'
  142. * Psize::                       `.psize LINES, COLUMNS'
  143. * Quad::            `.quad BIGNUMS'
  144. * Sbttl::            `.sbttl "SUBHEADING"'
  145. * Set::                `.set SYMBOL, EXPRESSION'
  146. * Short::            `.short EXPRESSIONS'
  147. * Single::            `.single FLONUMS'
  148. * Space::            `.space SIZE , FILL'
  149. * Stab::            `.stabd, .stabn, .stabs'
  150. * Text::            `.text SUBSECTION'
  151. * Title::            `.title "HEADING"'
  152. * Word::            `.word EXPRESSIONS'
  153. * Deprecated::            Deprecated Directives
  154.  
  155. 
  156. File: as.info,  Node: Abort,  Next: Align,  Prev: Pseudo Ops,  Up: Pseudo Ops
  157.  
  158. `.abort'
  159. ========
  160.  
  161.    This directive stops the assembly immediately.  It is for
  162. compatibility with other assemblers.  The original idea was that the
  163. assembly language source would be piped into the assembler.  If the
  164. sender of the source quit, it could use this directive tells `as' to
  165. quit also.  One day `.abort' will not be supported.
  166.  
  167. 
  168. File: as.info,  Node: Align,  Next: App-File,  Prev: Abort,  Up: Pseudo Ops
  169.  
  170. `.align ABS-EXPR , ABS-EXPR'
  171. ============================
  172.  
  173.    Pad the location counter (in the current subsection) to a particular
  174. storage boundary.  The first expression (which must be absolute) is the
  175. number of low-order zero bits the location counter will have after
  176. advancement.  For example `.align 3' will advance the location counter
  177. until it a multiple of 8.  If the location counter is already a
  178. multiple of 8, no change is needed.
  179.  
  180.    The second expression (also absolute) gives the value to be stored
  181. in the padding bytes.  It (and the comma) may be omitted.  If it is
  182. omitted, the padding bytes are zero.
  183.  
  184. 
  185. File: as.info,  Node: App-File,  Next: Ascii,  Prev: Align,  Up: Pseudo Ops
  186.  
  187. `.app-file STRING'
  188. ==================
  189.  
  190.    `.app-file' (which may also be spelled `.file') tells `as' that we
  191. are about to start a new logical file.  STRING is the new file name. 
  192. In general, the filename is recognized whether or not it is surrounded
  193. by quotes `"'; but if you wish to specify an empty file name is
  194. permitted, you must give the quotes--`""'.  This statement may go away
  195. in future: it is only recognized to be compatible with old `as'
  196. programs.
  197.  
  198. 
  199. File: as.info,  Node: Ascii,  Next: Asciz,  Prev: App-File,  Up: Pseudo Ops
  200.  
  201. `.ascii "STRING"'...
  202. ====================
  203.  
  204.    `.ascii' expects zero or more string literals (*note Strings::.)
  205. separated by commas.  It assembles each string (with no automatic
  206. trailing zero byte) into consecutive addresses.
  207.  
  208. 
  209. File: as.info,  Node: Asciz,  Next: Byte,  Prev: Ascii,  Up: Pseudo Ops
  210.  
  211. `.asciz "STRING"'...
  212. ====================
  213.  
  214.    `.asciz' is just like `.ascii', but each string is followed by a
  215. zero byte.  The "z" in `.asciz' stands for "zero".
  216.  
  217. 
  218. File: as.info,  Node: Byte,  Next: Comm,  Prev: Asciz,  Up: Pseudo Ops
  219.  
  220. `.byte EXPRESSIONS'
  221. ===================
  222.  
  223.    `.byte' expects zero or more expressions, separated by commas. 
  224. Each expression is assembled into the next byte.
  225.  
  226. 
  227. File: as.info,  Node: Comm,  Next: Data,  Prev: Byte,  Up: Pseudo Ops
  228.  
  229. `.comm SYMBOL , LENGTH '
  230. ========================
  231.  
  232.    `.comm' declares a named common area in the bss section.  Normally
  233. `ld' reserves memory addresses for it during linking, so no partial
  234. program defines the location of the symbol.  Use `.comm' to tell `ld'
  235. that it must be at least LENGTH bytes long.  `ld' will allocate space
  236. for each `.comm' symbol that is at least as long as the longest
  237. `.comm' request in any of the partial programs linked.  LENGTH is an
  238. absolute expression.
  239.  
  240. 
  241. File: as.info,  Node: Data,  Next: Desc,  Prev: Comm,  Up: Pseudo Ops
  242.  
  243. `.data SUBSECTION'
  244. ==================
  245.  
  246.    `.data' tells `as' to assemble the following statements onto the
  247. end of the data subsection numbered SUBSECTION (which is an absolute
  248. expression).  If SUBSECTION is omitted, it defaults to zero.
  249.  
  250. 
  251. File: as.info,  Node: Desc,  Next: Double,  Prev: Data,  Up: Pseudo Ops
  252.  
  253. `.desc SYMBOL, ABS-EXPRESSION'
  254. ==============================
  255.  
  256.    This directive sets the descriptor of the symbol (*note Symbol
  257. Attributes::.) to the low 16 bits of an absolute expression.
  258.  
  259. 
  260. File: as.info,  Node: Double,  Next: Eject,  Prev: Desc,  Up: Pseudo Ops
  261.  
  262. `.double FLONUMS'
  263. =================
  264.  
  265.    `.double' expects zero or more flonums, separated by commas.  It
  266. assembles floating point numbers.
  267.  
  268. 
  269. File: as.info,  Node: Eject,  Next: Else,  Prev: Double,  Up: Pseudo Ops
  270.  
  271. `.eject'
  272. ========
  273.  
  274.    Force a page break at this point, when generating assembly listings.
  275.  
  276. 
  277. File: as.info,  Node: Else,  Next: Endif,  Prev: Eject,  Up: Pseudo Ops
  278.  
  279. `.else'
  280. =======
  281.  
  282.    `.else' is part of the `as' support for conditional assembly; *note
  283. `.if': If..  It marks the beginning of a section of code to be
  284. assembled if the condition for the preceding `.if' was false.
  285.  
  286. 
  287. File: as.info,  Node: Endif,  Next: Equ,  Prev: Else,  Up: Pseudo Ops
  288.  
  289. `.endif'
  290. ========
  291.  
  292.    `.endif' is part of the `as' support for conditional assembly; it
  293. marks the end of a block of code that is only assembled conditionally.
  294.  *Note `.if': If.
  295.  
  296. 
  297. File: as.info,  Node: Equ,  Next: Extern,  Prev: Endif,  Up: Pseudo Ops
  298.  
  299. `.equ SYMBOL, EXPRESSION'
  300. =========================
  301.  
  302.    This directive sets the value of SYMBOL to EXPRESSION.  It is
  303. synonymous with `.set'; *note `.set': Set..
  304.  
  305. 
  306. File: as.info,  Node: Extern,  Next: File,  Prev: Equ,  Up: Pseudo Ops
  307.  
  308. `.extern'
  309. =========
  310.  
  311.    `.extern' is accepted in the source program--for compatibility with
  312. other assemblers--but it is ignored.  `as' treats all undefined
  313. symbols as external.
  314.  
  315. 
  316. File: as.info,  Node: File,  Next: Fill,  Prev: Extern,  Up: Pseudo Ops
  317.  
  318. `.file STRING'
  319. ==============
  320.  
  321.    `.file' (which may also be spelled `.app-file') tells `as' that we
  322. are about to start a new logical file.  STRING is the new file name. 
  323. In general, the filename is recognized whether or not it is surrounded
  324. by quotes `"'; but if you wish to specify an empty file name, you must
  325. give the quotes--`""'.  This statement may go away in future: it is
  326. only recognized to be compatible with old `as' programs.
  327.  
  328. 
  329. File: as.info,  Node: Fill,  Next: Float,  Prev: File,  Up: Pseudo Ops
  330.  
  331. `.fill REPEAT , SIZE , VALUE'
  332. =============================
  333.  
  334.    RESULT, SIZE and VALUE are absolute expressions.  This emits REPEAT
  335. copies of SIZE bytes.  REPEAT may be zero or more.  SIZE may be zero
  336. or more, but if it is more than 8, then it is deemed to have the value
  337. 8, compatible with other people's assemblers.  The contents of each
  338. REPEAT bytes is taken from an 8-byte number.  The highest order 4
  339. bytes are zero.  The lowest order 4 bytes are VALUE rendered in the
  340. byte-order of an integer on the computer `as' is assembling for.  Each
  341. SIZE bytes in a repetition is taken from the lowest order SIZE bytes
  342. of this number.  Again, this bizarre behavior is compatible with other
  343. people's assemblers.
  344.  
  345.    SIZE and VALUE are optional.  If the second comma and VALUE are
  346. absent, VALUE is assumed zero.  If the first comma and following
  347. tokens are absent, SIZE is assumed to be 1.
  348.  
  349. 
  350. File: as.info,  Node: Float,  Next: Global,  Prev: Fill,  Up: Pseudo Ops
  351.  
  352. `.float FLONUMS'
  353. ================
  354.  
  355.    This directive assembles zero or more flonums, separated by commas.
  356.  It has the same effect as `.single'.
  357.  
  358. 
  359. File: as.info,  Node: Global,  Next: hword,  Prev: Float,  Up: Pseudo Ops
  360.  
  361. `.global SYMBOL', `.globl SYMBOL'
  362. =================================
  363.  
  364.    `.global' makes the symbol visible to `ld'.  If you define SYMBOL
  365. in your partial program, its value is made available to other partial
  366. programs that are linked with it.  Otherwise, SYMBOL will take its
  367. attributes from a symbol of the same name from another partial program
  368. it is linked with.
  369.  
  370.    Both spellings (`.globl' and `.global') are accepted, for
  371. compatibility with other assemblers.
  372.  
  373. 
  374. File: as.info,  Node: hword,  Next: Ident,  Prev: Global,  Up: Pseudo Ops
  375.  
  376. `.hword EXPRESSIONS'
  377. ====================
  378.  
  379.    This expects zero or more EXPRESSIONS, and emits a 16 bit number
  380. for each.
  381.  
  382.    This directive is a synonym for both `.short' and `.word'.
  383.  
  384. 
  385. File: as.info,  Node: Ident,  Next: If,  Prev: hword,  Up: Pseudo Ops
  386.  
  387. `.ident'
  388. ========
  389.  
  390.    This directive is used by some assemblers to place tags in object
  391. files.  `as' simply accepts the directive for source-file
  392. compatibility with such assemblers, but does not actually emit anything
  393. for it.
  394.  
  395. 
  396. File: as.info,  Node: If,  Next: Include,  Prev: Ident,  Up: Pseudo Ops
  397.  
  398. `.if ABSOLUTE EXPRESSION'
  399. =========================
  400.  
  401.    `.if' marks the beginning of a section of code which is only
  402. considered part of the source program being assembled if the argument
  403. (which must be an ABSOLUTE EXPRESSION) is non-zero.  The end of the
  404. conditional section of code must be marked by `.endif' (*note
  405. `.endif': Endif.); optionally, you may include code for the
  406. alternative condition, flagged by `.else' (*note `.else': Else..
  407.  
  408.    The following variants of `.if' are also supported:
  409. `.ifdef SYMBOL'
  410.      Assembles the following section of code if the specified SYMBOL
  411.      has been defined.
  412.  
  413. `.ifndef SYMBOL'
  414. `ifnotdef SYMBOL'
  415.      Assembles the following section of code if the specified SYMBOL
  416.      has not been defined.  Both spelling variants are equivalent.
  417.  
  418. 
  419. File: as.info,  Node: Include,  Next: Int,  Prev: If,  Up: Pseudo Ops
  420.  
  421. `.include "FILE"'
  422. =================
  423.  
  424.    This directive provides a way to include supporting files at
  425. specified points in your source program.  The code from FILE is
  426. assembled as if it followed the point of the `.include'; when the end
  427. of the included file is reached, assembly of the original file
  428. continues.  You can control the search paths used with the `-I'
  429. command-line option (*note Command-Line Options: Invoking.). 
  430. Quotation marks are required around FILE.
  431.  
  432. 
  433. File: as.info,  Node: Int,  Next: Lcomm,  Prev: Include,  Up: Pseudo Ops
  434.  
  435. `.int EXPRESSIONS'
  436. ==================
  437.  
  438.    Expect zero or more EXPRESSIONS, of any section, separated by
  439. commas.  For each expression, emit a 32-bit number that will, at run
  440. time, be the value of that expression.  The byte order of the
  441. expression depends on what kind of computer will run the program.
  442.  
  443. 
  444. File: as.info,  Node: Lcomm,  Next: Lflags,  Prev: Int,  Up: Pseudo Ops
  445.  
  446. `.lcomm SYMBOL , LENGTH'
  447. ========================
  448.  
  449.    Reserve LENGTH (an absolute expression) bytes for a local common
  450. denoted by SYMBOL.  The section and value of SYMBOL are those of the
  451. new local common.  The addresses are allocated in the bss section, so
  452. at run-time the bytes will start off zeroed.  SYMBOL is not declared
  453. global (*note `.global': Global.), so is normally not visible to `ld'.
  454.  
  455. 
  456. File: as.info,  Node: Lflags,  Next: Line,  Prev: Lcomm,  Up: Pseudo Ops
  457.  
  458. `.lflags'
  459. =========
  460.  
  461.    `as' accepts this directive, for compatibility with other
  462. assemblers, but ignores it.
  463.  
  464. 
  465. File: as.info,  Node: Line,  Next: Ln,  Prev: Lflags,  Up: Pseudo Ops
  466.  
  467. `.line LINE-NUMBER'
  468. ===================
  469.  
  470.    Tell `as' to change the logical line number.  LINE-NUMBER must be
  471. an absolute expression.  The next line will have that logical line
  472. number.  So any other statements on the current line (after a statement
  473. separator character `;') will be reported as on logical line number
  474. LINE-NUMBER - 1.  One day this directive will be unsupported: it is
  475. used only for compatibility with existing assembler programs.
  476.  
  477. 
  478. File: as.info,  Node: Ln,  Next: List,  Prev: Line,  Up: Pseudo Ops
  479.  
  480. `.ln LINE-NUMBER'
  481. =================
  482.  
  483.    `.ln' is a synonym for `.line'.
  484.  
  485. 
  486. File: as.info,  Node: List,  Next: Long,  Prev: Ln,  Up: Pseudo Ops
  487.  
  488. `.list'
  489. =======
  490.  
  491.    Control (in conjunction with the `.nolist' directive) whether or
  492. not assembly listings are generated.  These two directives maintain an
  493. internal counter (which is zero initially).   `.list' increments the
  494. counter, and `.nolist' decrements it.  Assembly listings are generated
  495. whenever the counter is greater than zero.
  496.  
  497.    By default, listings are disabled.  When you enable them (with the
  498. `-a' command line option; *note Command-Line Options: Invoking.), the
  499. initial value of the listing counter is one.
  500.  
  501. 
  502. File: as.info,  Node: Long,  Next: Lsym,  Prev: List,  Up: Pseudo Ops
  503.  
  504. `.long EXPRESSIONS'
  505. ===================
  506.  
  507.    `.long' is the same as `.int', *note `.int': Int..
  508.  
  509. 
  510. File: as.info,  Node: Lsym,  Next: Nolist,  Prev: Long,  Up: Pseudo Ops
  511.  
  512. `.lsym SYMBOL, EXPRESSION'
  513. ==========================
  514.  
  515.    `.lsym' creates a new symbol named SYMBOL, but does not put it in
  516. the hash table, ensuring it cannot be referenced by name during the
  517. rest of the assembly.  This sets the attributes of the symbol to be
  518. the same as the expression value:
  519.      OTHER = DESCRIPTOR = 0
  520.      TYPE = (section of EXPRESSION)
  521.      VALUE = EXPRESSION
  522.  
  523. The new symbol is not flagged as external.
  524.  
  525. 
  526. File: as.info,  Node: Nolist,  Next: Octa,  Prev: Lsym,  Up: Pseudo Ops
  527.  
  528. `.nolist'
  529. =========
  530.  
  531.    Control (in conjunction with the `.list' directive) whether or not
  532. assembly listings are generated.  These two directives maintain an
  533. internal counter (which is zero initially).   `.list' increments the
  534. counter, and `.nolist' decrements it.  Assembly listings are generated
  535. whenever the counter is greater than zero.
  536.  
  537. 
  538. File: as.info,  Node: Octa,  Next: Org,  Prev: Nolist,  Up: Pseudo Ops
  539.  
  540. `.octa BIGNUMS'
  541. ===============
  542.  
  543.    This directive expects zero or more bignums, separated by commas. 
  544. For each bignum, it emits a 16-byte integer.
  545.  
  546.    The term "octa" comes from contexts in which a "word" is two bytes;
  547. hence *octa*-word for 16 bytes.
  548.  
  549. 
  550. File: as.info,  Node: Org,  Next: Psize,  Prev: Octa,  Up: Pseudo Ops
  551.  
  552. `.org NEW-LC , FILL'
  553. ====================
  554.  
  555.    `.org' will advance the location counter of the current section to
  556. NEW-LC.  NEW-LC is either an absolute expression or an expression with
  557. the same section as the current subsection.  That is, you can't use
  558. `.org' to cross sections: if NEW-LC has the wrong section, the `.org'
  559. directive is ignored.  To be compatible with former assemblers, if the
  560. section of NEW-LC is absolute, `as' will issue a warning, then pretend
  561. the section of NEW-LC is the same as the current subsection.
  562.  
  563.    `.org' may only increase the location counter, or leave it
  564. unchanged; you cannot use `.org' to move the location counter
  565. backwards.
  566.  
  567.    Because `as' tries to assemble programs in one pass NEW-LC may not
  568. be undefined.  If you really detest this restriction we eagerly await
  569. a chance to share your improved assembler.
  570.  
  571.    Beware that the origin is relative to the start of the section, not
  572. to the start of the subsection.  This is compatible with other
  573. people's assemblers.
  574.  
  575.    When the location counter (of the current subsection) is advanced,
  576. the intervening bytes are filled with FILL which should be an absolute
  577. expression.  If the comma and FILL are omitted, FILL defaults to zero.
  578.  
  579. 
  580. File: as.info,  Node: Psize,  Next: Quad,  Prev: Org,  Up: Pseudo Ops
  581.  
  582. `.psize LINES , COLUMNS'
  583. ========================
  584.  
  585.    Use this directive to declare the number of lines--and, optionally,
  586. the number of columns--to use for each page, when generating listings.
  587.  
  588.    If you don't use `.psize', listings will use a default line-count
  589. of 60.  You may omit the comma and COLUMNS specification; the default
  590. width is 200 columns.
  591.  
  592.    `as' will generate formfeeds whenever the specified number of lines
  593. is exceeded (or whenever you explicitly request one, using `.eject').
  594.  
  595.    If you specify LINES as `0', no formfeeds are generated save those
  596. explicitly specified with `.eject'.
  597.  
  598. 
  599. File: as.info,  Node: Quad,  Next: Sbttl,  Prev: Psize,  Up: Pseudo Ops
  600.  
  601. `.quad BIGNUMS'
  602. ===============
  603.  
  604.    `.quad' expects zero or more bignums, separated by commas.  For
  605. each bignum, it emits an 8-byte integer.  If the bignum won't fit in 8
  606. bytes, it prints a warning message; and just takes the lowest order 8
  607. bytes of the bignum.
  608.  
  609.    The term "quad" comes from contexts in which a "word" is two bytes;
  610. hence *quad*-word for 8 bytes.
  611.  
  612. 
  613. File: as.info,  Node: Sbttl,  Next: Set,  Prev: Quad,  Up: Pseudo Ops
  614.  
  615. `.sbttl "SUBHEADING"'
  616. =====================
  617.  
  618.    Use SUBHEADING as the title (third line, immediately after the
  619. title line) when generating assembly listings.
  620.  
  621.    This directive affects subsequent pages, as well as the current
  622. page if it appears within ten lines of the top of a page.
  623.  
  624. 
  625. File: as.info,  Node: Set,  Next: Short,  Prev: Quad,  Up: Pseudo Ops
  626.  
  627. `.set SYMBOL, EXPRESSION'
  628. =========================
  629.  
  630.    This directive sets the value of SYMBOL to EXPRESSION.  This will
  631. change SYMBOL's value and type to conform to EXPRESSION.  If SYMBOL
  632. was flagged as external, it remains flagged. (*Note Symbol
  633. Attributes::.)
  634.  
  635.    You may `.set' a symbol many times in the same assembly.  If the
  636. expression's section is unknowable during pass 1, a second pass over
  637. the source program will be forced.  The second pass is currently not
  638. implemented.  `as' will abort with an error message if one is required.
  639.  
  640.    If you `.set' a global symbol, the value stored in the object file
  641. is the last value stored into it.
  642.  
  643. 
  644. File: as.info,  Node: Short,  Next: Single,  Prev: Set,  Up: Pseudo Ops
  645.  
  646. `.short EXPRESSIONS'
  647. ====================
  648.  
  649.    `.short' is the same as `.word'.  *Note `.word': Word.
  650.  
  651. 
  652. File: as.info,  Node: Single,  Next: Space,  Prev: Short,  Up: Pseudo Ops
  653.  
  654. `.single FLONUMS'
  655. =================
  656.  
  657.    This directive assembles zero or more flonums, separated by commas.
  658.  It has the same effect as `.float'.
  659.  
  660. 
  661. File: as.info,  Node: Space,  Next: Stab,  Prev: Single,  Up: Pseudo Ops
  662.  
  663. `.space SIZE , FILL'
  664. ====================
  665.  
  666.    This directive emits SIZE bytes, each of value FILL.  Both SIZE and
  667. FILL are absolute expressions.  If the comma and FILL are omitted,
  668. FILL is assumed to be zero.
  669.  
  670. 
  671. File: as.info,  Node: Stab,  Next: Text,  Prev: Space,  Up: Pseudo Ops
  672.  
  673. `.stabd, .stabn, .stabs'
  674. ========================
  675.  
  676.    There are three directives that begin `.stab'.  All emit symbols
  677. (*note Symbols::.), for use by symbolic debuggers.  The symbols are
  678. not entered in the `as' hash table: they cannot be referenced
  679. elsewhere in the source file.  Up to five fields are required:
  680. STRING
  681.      This is the symbol's name.  It may contain any character except
  682.      `\000', so is more general than ordinary symbol names.  Some
  683.      debuggers used to code arbitrarily complex structures into symbol
  684.      names using this field.
  685.  
  686. TYPE
  687.      An absolute expression.  The symbol's type is set to the low 8
  688.      bits of this expression.  Any bit pattern is permitted, but `ld'
  689.      and debuggers will choke on silly bit patterns.
  690.  
  691. OTHER
  692.      An absolute expression.  The symbol's "other" attribute is set to
  693.      the low 8 bits of this expression.
  694.  
  695. DESC
  696.      An absolute expression.  The symbol's descriptor is set to the
  697.      low 16 bits of this expression.
  698.  
  699. VALUE
  700.      An absolute expression which becomes the symbol's value.
  701.  
  702.    If a warning is detected while reading a `.stabd', `.stabn', or
  703. `.stabs' statement, the symbol has probably already been created and
  704. you will get a half-formed symbol in your object file.  This is
  705. compatible with earlier assemblers!
  706.  
  707. `.stabd TYPE , OTHER , DESC'
  708.      The "name" of the symbol generated is not even an empty string. 
  709.      It is a null pointer, for compatibility.  Older assemblers used a
  710.      null pointer so they didn't waste space in object files with empty
  711.      strings.
  712.  
  713.      The symbol's value is set to the location counter, relocatably. 
  714.      When your program is linked, the value of this symbol will be
  715.      where the location counter was when the `.stabd' was assembled.
  716.  
  717. `.stabn TYPE , OTHER , DESC , VALUE'
  718.      The name of the symbol is set to the empty string `""'.
  719.  
  720. `.stabs STRING ,  TYPE , OTHER , DESC , VALUE'
  721.      All five fields are specified.
  722.  
  723. 
  724. File: as.info,  Node: Text,  Next: Title,  Prev: Stab,  Up: Pseudo Ops
  725.  
  726. `.text SUBSECTION'
  727. ==================
  728.  
  729.    Tells `as' to assemble the following statements onto the end of the
  730. text subsection numbered SUBSECTION, which is an absolute expression. 
  731. If SUBSECTION is omitted, subsection number zero is used.
  732.  
  733. 
  734. File: as.info,  Node: Title,  Next: Word,  Prev: Text,  Up: Pseudo Ops
  735.  
  736. `.title "HEADING"'
  737. ==================
  738.  
  739.    Use HEADING as the title (second line, immediately after the source
  740. file name and pagenumber) when generating assembly listings.
  741.  
  742.    This directive affects subsequent pages, as well as the current
  743. page if it appears within ten lines of the top of a page.
  744.  
  745. 
  746. File: as.info,  Node: Word,  Next: Deprecated,  Prev: Text,  Up: Pseudo Ops
  747.  
  748. `.word EXPRESSIONS'
  749. ===================
  750.  
  751.    This directive expects zero or more EXPRESSIONS, of any section,
  752. separated by commas.  For each expression, `as' emits a 16-bit number.
  753.  
  754.      *Warning: Special Treatment to support Compilers*
  755.  
  756.    In order to assemble compiler output into something that will work,
  757. `as' will occasionlly do strange things to `.word' directives. 
  758. Directives of the form `.word sym1-sym2' are often emitted by
  759. compilers as part of jump tables.  Therefore, when `as' assembles a
  760. directive of the form `.word sym1-sym2', and the difference between
  761. `sym1' and `sym2' does not fit in 16 bits, `as' will create a
  762. "secondary jump table", immediately before the next label.  This
  763. secondary jump table will be preceded by a short-jump to the first
  764. byte after the secondary table.  This short-jump prevents the flow of
  765. control from accidentally falling into the new table.  Inside the
  766. table will be a long-jump to `sym2'.  The original `.word' will
  767. contain `sym1' minus the address of the long-jump to `sym2'.
  768.  
  769.    If there were several occurrences of `.word sym1-sym2' before the
  770. secondary jump table, all of them will be adjusted.  If there was a
  771. `.word sym3-sym4', that also did not fit in sixteen bits, a long-jump
  772. to `sym4' will be included in the secondary jump table, and the
  773. `.word' directives will be adjusted to contain `sym3' minus the
  774. address of the long-jump to `sym4'; and so on, for as many entries in
  775. the original jump table as necessary.
  776.  
  777. 
  778. File: as.info,  Node: Deprecated,  Prev: Word,  Up: Pseudo Ops
  779.  
  780. Deprecated Directives
  781. =====================
  782.  
  783.    One day these directives won't work.  They are included for
  784. compatibility with older assemblers.
  785. .abort
  786. .app-file
  787. .line
  788. 
  789. File: as.info,  Node: M68K-Dependent,  Next: Copying,  Prev: Pseudo Ops,  Up: Top
  790.  
  791. M680x0 Dependent Features
  792. *************************
  793.  
  794. * Menu:
  795.  
  796. * M68K-Opts::            M680x0 Options
  797. * M68K-Syntax::            Syntax
  798. * M68K-Float::            Floating Point
  799. * M68K-Directives::        680x0 Machine Directives
  800. * M68K-opcodes::        Opcodes
  801.  
  802. 
  803. File: as.info,  Node: M68K-Opts,  Next: M68K-Syntax,  Prev: M68K-Dependent,  Up: M68K-Dependent
  804.  
  805. M680x0 Options
  806. ==============
  807.  
  808.    The Motorola 680x0 version of `as' has two machine dependent
  809. options.  One shortens undefined references from 32 to 16 bits, while
  810. the other is used to tell `as' what kind of machine it is assembling
  811. for.
  812.  
  813.    You can use the `-l' option to shorten the size of references to
  814. undefined symbols.  If the `-l' option is not given, references to
  815. undefined symbols will be a full long (32 bits) wide.  (Since `as'
  816. cannot know where these symbols will end up, `as' can only allocate
  817. space for the linker to fill in later.  Since `as' doesn't know how
  818. far away these symbols will be, it allocates as much space as it can.)
  819. If this option is given, the references will only be one word wide (16
  820. bits).  This may be useful if you want the object file to be as small
  821. as possible, and you know that the relevant symbols will be less than
  822. 17 bits away.
  823.  
  824.    The 680x0 version of `as' is most frequently used to assemble
  825. programs for the Motorola MC68020 microprocessor.  Occasionally it is
  826. used to assemble programs for the mostly similar, but slightly
  827. different MC68000 or MC68010 microprocessors.  You can give `as' the
  828. options `-m68000', `-mc68000', `-m68010', `-mc68010', `-m68020', and
  829. `-mc68020' to tell it what processor is the target.
  830.  
  831. 
  832. File: as.info,  Node: M68K-Syntax,  Next: M68K-Float,  Prev: M68K-Opts,  Up: M68K-Dependent
  833.  
  834. Syntax
  835. ======
  836.  
  837.    The 680x0 version of `as' uses syntax similar to the Sun assembler. 
  838. Size modifiers are appended directly to the end of the opcode without
  839. an intervening period.  For example, write `movl' rather than `move.l'.
  840.  
  841.    In the following table "apc" stands for any of the address
  842. registers (`a0' through `a7'), nothing, (`'), the Program Counter
  843. (`pc'), or the zero-address relative to the program counter (`zpc').
  844.  
  845.    The following addressing modes are understood:
  846. "Immediate"
  847.      `#DIGITS'
  848.  
  849. "Data Register"
  850.      `d0' through `d7'
  851.  
  852. "Address Register"
  853.      `a0' through `a7'
  854.  
  855. "Address Register Indirect"
  856.      `a0@' through `a7@'
  857.  
  858. "Address Register Postincrement"
  859.      `a0@+' through `a7@+'
  860.  
  861. "Address Register Predecrement"
  862.      `a0@-' through `a7@-'
  863.  
  864. "Indirect Plus Offset"
  865.      `APC@(DIGITS)'
  866.  
  867. "Index"
  868.      `APC@(DIGITS,REGISTER:SIZE:SCALE)'
  869.  
  870.      or `APC@(REGISTER:SIZE:SCALE)'
  871.  
  872. "Postindex"
  873.      `APC@(DIGITS)@(DIGITS,REGISTER:SIZE:SCALE)'
  874.  
  875.      or `APC@(DIGITS)@(REGISTER:SIZE:SCALE)'
  876.  
  877. "Preindex"
  878.      `APC@(DIGITS,REGISTER:SIZE:SCALE)@(DIGITS)'
  879.  
  880.      or `APC@(REGISTER:SIZE:SCALE)@(DIGITS)'
  881.  
  882. "Memory Indirect"
  883.      `APC@(DIGITS)@(DIGITS)'
  884.  
  885. "Absolute"
  886.      `SYMBOL', or `DIGITS'
  887.  
  888. 
  889. File: as.info,  Node: M68K-Float,  Next: M68K-Directives,  Prev: M68K-Syntax,  Up: M68K-Dependent
  890.  
  891. Floating Point
  892. ==============
  893.  
  894.    The floating point code is not too well tested, and may have subtle
  895. bugs in it.
  896.  
  897.    Packed decimal (P) format floating literals are not supported. 
  898. Feel free to add the code!
  899.  
  900.    The floating point formats generated by directives are these.
  901.  
  902. `.float'
  903.      `Single' precision floating point constants.
  904.  
  905. `.double'
  906.      `Double' precision floating point constants.
  907.  
  908.    There is no directive to produce regions of memory holding extended
  909. precision numbers, however they can be used as immediate operands to
  910. floating-point instructions.  Adding a directive to create extended
  911. precision numbers would not be hard, but it has not yet seemed
  912. necessary.
  913.  
  914. 
  915. File: as.info,  Node: M68K-Directives,  Next: M68K-opcodes,  Prev: M68K-Float,  Up: M68K-Dependent
  916.  
  917. 680x0 Machine Directives
  918. ========================
  919.  
  920.    In order to be compatible with the Sun assembler the 680x0 assembler
  921. understands the following directives.
  922.  
  923. `.data1'
  924.      This directive is identical to a `.data 1' directive.
  925.  
  926. `.data2'
  927.      This directive is identical to a `.data 2' directive.
  928.  
  929. `.even'
  930.      This directive is identical to a `.align 1' directive.
  931.  
  932. `.skip'
  933.      This directive is identical to a `.space' directive.
  934.  
  935. 
  936. File: as.info,  Node: M68K-opcodes,  Prev: M68K-Directives,  Up: M68K-Dependent
  937.  
  938. Opcodes
  939. =======
  940.  
  941. * Menu:
  942.  
  943. * M68K-Branch::            Branch Improvement
  944. * M68K-Chars::            Special Characters
  945.  
  946. 
  947. File: as.info,  Node: M68K-Branch,  Next: M68K-Chars,  Prev: M68K-opcodes,  Up: M68K-opcodes
  948.  
  949. Branch Improvement
  950. ------------------
  951.  
  952.    Certain pseudo opcodes are permitted for branch instructions.  They
  953. expand to the shortest branch instruction that will reach the target. 
  954. Generally these mnemonics are made by substituting `j' for `b' at the
  955. start of a Motorola mnemonic.
  956.  
  957.    The following table summarizes the pseudo-operations.  A `*' flags
  958. cases that are more fully described after the table:
  959.  
  960.                Displacement
  961.                +---------------------------------------------------------
  962.                |                68020   68000/10
  963.      Pseudo-Op |BYTE    WORD    LONG    LONG      non-PC relative
  964.                +---------------------------------------------------------
  965.           jbsr |bsrs    bsr     bsrl    jsr       jsr
  966.            jra |bras    bra     bral    jmp       jmp
  967.      *     jXX |bXXs    bXX     bXXl    bNXs;jmpl bNXs;jmp
  968.      *    dbXX |dbXX    dbXX        dbXX; bra; jmpl
  969.      *    fjXX |fbXXw   fbXXw   fbXXl             fbNXw;jmp
  970.      
  971.      XX: condition
  972.      NX: negative of condition XX
  973.  
  974.                       `*'--see full description below
  975.  
  976. `jbsr'
  977. `jra'
  978.      These are the simplest jump pseudo-operations; they always map to
  979.      one particular machine instruction, depending on the displacement
  980.      to the branch target.
  981.  
  982. `jXX'
  983.      Here, `jXX' stands for an entire family of pseudo-operations,
  984.      where XX is a conditional branch or condition-code test.  The full
  985.      list of pseudo-ops in this family is:
  986.            jhi   jls   jcc   jcs   jne   jeq   jvc
  987.            jvs   jpl   jmi   jge   jlt   jgt   jle
  988.  
  989.      For the cases of non-PC relative displacements and long
  990.      displacements on the 68000 or 68010, `as' will issue a longer
  991.      code fragment in terms of NX, the opposite condition to XX:
  992.               jXX foo
  993.      gives
  994.                bNXs oof
  995.                jmp foo
  996.            oof:
  997.  
  998. `dbXX'
  999.      The full family of pseudo-operations covered here is
  1000.            dbhi   dbls   dbcc   dbcs   dbne   dbeq   dbvc
  1001.            dbvs   dbpl   dbmi   dbge   dblt   dbgt   dble
  1002.            dbf    dbra   dbt
  1003.  
  1004.      Other than for word and byte displacements, when the source reads
  1005.      `dbXX foo', `as' will emit
  1006.                dbXX oo1
  1007.                bra oo2
  1008.            oo1:jmpl foo
  1009.            oo2:
  1010.  
  1011. `fjXX'
  1012.      This family includes
  1013.            fjne   fjeq   fjge   fjlt   fjgt   fjle   fjf
  1014.            fjt    fjgl   fjgle  fjnge  fjngl  fjngle fjngt
  1015.            fjnle  fjnlt  fjoge  fjogl  fjogt  fjole  fjolt
  1016.            fjor   fjseq  fjsf   fjsne  fjst   fjueq  fjuge
  1017.            fjugt  fjule  fjult  fjun
  1018.  
  1019.      For branch targets that are not PC relative, `as' emits
  1020.                fbNX oof
  1021.                jmp foo
  1022.            oof:
  1023.      when it encounters `fjXX foo'.
  1024.  
  1025. 
  1026. File: as.info,  Node: M68K-Chars,  Prev: M68K-Branch,  Up: M68K-opcodes
  1027.  
  1028. Special Characters
  1029. ------------------
  1030.  
  1031.    The immediate character is `#' for Sun compatibility.  The
  1032. line-comment character is `|'.  If a `#' appears at the beginning of a
  1033. line, it is treated as a comment unless it looks like `# line file',
  1034. in which case it is treated normally.
  1035.  
  1036.